﻿using Sys.Core.Models.Dto;
using Sys.Core.Models.Queries;
using Sys.Core.Models.VO;
using MiniFox.Components;
using MiniFox.Infrastructure;

namespace Sys.Core.Providers
{
    /// <summary>
    /// 
    /// </summary>
    [AutoRegister]
    public interface IApplicationProvider
    {
        #region application
        /// <summary>
        /// 
        /// </summary>
        /// <param name="applicationId"></param>
        /// <returns></returns>
        ApplicationVo GetApplication(string appId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="application"></param>
        /// <returns></returns>
        bool CreateApplication(ApplicationDto application, string secretKey);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="application"></param>
        /// <returns></returns>
        bool UpdateApplication(ApplicationDto application);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="application"></param>
        /// <returns></returns>
        bool DeleteApplication(params string[] apps);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="appId"></param>
        /// <returns></returns>
        bool ToggleApplication(string appId);
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        ResultObject<IEnumerable<ApplicationVo>> Query(PagedQueryObject<AppQuery> request);

        #endregion

        /// <summary>
        /// 
        /// </summary>
        /// <param name="appId"></param>
        /// <returns></returns>
        string GetSecretKey(string appId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="secretKey"></param>
        /// <returns></returns>
        void SetSecretKey(string appId, string secretKey);


        #region module

        /// <summary>
        /// 
        /// </summary>
        /// <param name="module"></param>
        /// <returns></returns>
        bool CreateModule(ModuleDto module);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="module"></param>
        /// <returns></returns>
        bool UpdateModule(ModuleDto module);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="module"></param>
        /// <returns></returns>
        bool DeleteModule(params string[] modules);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="moduleId"></param>
        /// <returns></returns>
        ModuleVo GetModule(string moduleId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<ModuleVo>> QueryModules(PagedQueryObject<ModuleQuery> request);
        #endregion

        #region 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="moduleAction"></param>
        /// <returns></returns>
        bool CreateModuleAction(ModuleActionDto moduleAction);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="moduleAction"></param>
        /// <returns></returns>
        bool UpdateModuleAction(ModuleActionDto moduleAction);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="moduleActions"></param>
        bool DeleteModuleAction(string[] moduleActions);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="actionId"></param>
        /// <returns></returns>
        ModuleActionVo GetModuleAction(string actionId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="moduleId"></param>
        /// <returns></returns>
        IEnumerable<ModuleActionVo> GetModuleActions(string moduleId);
        #endregion

    }
}
